]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Fix nonsense condition
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Jan 2019 21:43:41 +0000 (22:43 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 30 Jan 2019 16:13:16 +0000 (16:13 +0000)
Just like the "in" operator in the previous patch, "instanceof" has
a lower precedence than negation, resulting in the nonsense condition
of "true instanceof BaseIcon".

Add parentheses to get the intended behavior.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375

js/ui/iconGrid.js

index 6d6e2284f33258d636cb69e8ad9ee49721d09740..cd54d50a34a350b452423f315f3a9fcb3e959826 100644 (file)
@@ -670,7 +670,7 @@ var IconGrid = GObject.registerClass({
     }
 
     addItem(item, index) {
-        if (!item.icon instanceof BaseIcon)
+        if (!(item.icon instanceof BaseIcon))
             throw new Error('Only items with a BaseIcon icon property can be added to IconGrid');
 
         this._items.push(item);